<template>
  <hry-header title="项目详情" :showBackBtn="true">
    <hry-detail-card slot="content" :cardInfo="detailInfo"></hry-detail-card>
  </hry-header>
</template>

<script>
export default {
  name: "detail",
  components: {
    hryHeader: () => import("@/components/contentWrapper/index"),
    hryDetailCard: () => import("@/components/project/projectDetailCard")
  },
  data() {
    return {
      detailInfo: {
        thumb: [],
        new_list: []
      }
    };
  },
  methods: {
    getDetailProject() {
      this.$ajax
        .post(this.$api.detailProject, { project_id: this.$route.params.id })
        .then(res => {
          this.detailInfo = res.data;
          let tLength = this.detailInfo.thumb.length;
          if (tLength > 0 && this.detailInfo.thumb[tLength - 1] === "") {
            this.detailInfo.thumb.pop();
          }
        })
        .catch(err => {
          this.$message.error(err);
        });
    }
  },
  created() {
    this.getDetailProject();
  }
};
</script>

<style scoped lang="less"></style>
